<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../jquery.min.js"></script>
    <style>
        div {
            width: 200px;
            height: 200px;
            background-color: palegreen;
        }
    </style>
</head>

<body>
    <script>
        // 法1
        $(document).ready(function () {
            $('div').hide();
        })
        // 法2
        $(function () {
            $('div').hide();
        })
    </script>
    <div></div>

</body>

</html>